# -- coding:UTF-8 --
#!/usr/bin/env python

import glob
import os
import sys
import time

try:
    sys.path.append(glob.glob('/home/cwx/cwx_ws/carla/PythonAPI/carla/dist/carla-*%d.%d-%s.egg' % (
        sys.version_info.major,
        sys.version_info.minor,
        'win-amd64' if os.name == 'nt' else 'linux-x86_64'))[0])
except IndexError:
    pass

import carla

try:
    client = carla.Client('localhost', 2000)
except Exception as e:
    print(e)

world = client.get_world()
map = world.get_map()

spawn_points = map.get_spawn_points()
print(spawn_points)

debug = world.debug

for i in spawn_points:
    debug.draw_point(i.location, 1, carla.Color(255, 0, 0), life_time=10)